<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
    <title>Anasit</title>
    <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/css/themes/maintheme.css"/>
</h:head>
<h:body>
    <div id="container">
        <div id="header">
            <h1>
                Site name
            </h1>
        </div>
        <div id="navigation">
            <h:form>
                <p:menubar autoSubmenuDisplay="true">
                    <p:submenu label="File">
                        <p:submenu label="New">
                            <p:menuitem value="Project" url="#"/>
                            <p:menuitem value="Other" url="#"/>
                        </p:submenu>
                        <p:menuitem value="Open" url="#"/>
                        <p:menuitem value="Quit" url="#"/>
                    </p:submenu>
                    <p:submenu label="Edit">
                        <p:menuitem value="Undo" url="#"/>
                        <p:menuitem value="Redo" url="#"/>
                    </p:submenu>
                    <p:submenu label="Help">
                        <p:submenu label="Search">
                            <p:submenu label="Text">
                                <p:menuitem value="Workspace" url="#"/>
                            </p:submenu>
                            <p:menuitem value="File" url="#"/>
                        </p:submenu>
                        <p:menuitem label="Contents" url="#"/>
                    </p:submenu>
                </p:menubar>
            </h:form>
        </div>


        <div id="content-container">
            <div id="aside">
                <h:form>
                    <p:menu>
                        <p:submenu label="Mail">
                            <p:menuitem value="Gmail" url="http://www.google.com"/>
                            <p:menuitem value="Hotmail" url="http://www.hotmail.com"/>
                            <p:menuitem value="Yahoo Mail" url="http://mail.yahoo.com"/>
                        </p:submenu>
                        <p:submenu label="Videos">
                            <p:menuitem value="Youtube" url="http://www.youtube.com"/>
                            <p:menuitem value="Break" url="http://www.break.com"/>
                            <p:menuitem value="Metacafe" url="http://www.metacafe.com"/>
                        </p:submenu>
                        <p:submenu label="Social Networks">
                            <p:menuitem value="Facebook" url="http://www.facebook.com"/>
                            <p:menuitem value="MySpace" url="http://www.myspace.com"/>
                        </p:submenu>
                    </p:menu>
                </h:form>
            </div>


            <div id="content">
                <p:fieldset legend="Create User">
                    <p:growl id="saved"/>
                    <h:form id="create">
                        <p:messages showSummary="true"/>
                        <h:panelGrid id="grid" columns="3">
                            <h:outputText value="#{msgs.firstName}"/>
                            <p:inputText value="#{anasitUserBean.anasitUser.name.firstName}" id="firstname"
                                         requiredMessage="Please type in someyin" required="true"/>
                            <p:message for="firstname"/>

                            <h:outputText value="#{msgs.middleName}"/>
                            <p:inputText value="#{anasitUserBean.anasitUser.name.middleName}" id="middlename"
                                         requiredMessage="Please type in middlename" required="true"/>
                            <p:message for="middlename"/>

                            <h:outputText value="#{msgs.lastName}"/>
                            <p:inputText value="#{anasitUserBean.anasitUser.name.lastName}" id="lastname"
                                         requiredMessage="Please type in lastname" required="true"/>
                            <p:message for="lastname"/>

                            <h:outputText value="#{msgs.userName}"/>
                            <p:inputText value="#{anasitUserBean.anasitUser.userName}" id="username" required="true"/>
                            <p:message for="username"/>

                            <h:outputText value="#{msgs.userPassword}"/>
                            <p:password value="#{anasitUserBean.anasitUser.passString}" id="passwd" minLength="6"
                                        feedback="true"/>
                            <p:message for="passwd"/>

                        </h:panelGrid>
                        <h:panelGrid columns="2">
                            <p:spacer width="22"/>
                            <p:commandButton value="#{msgs.Savebutton}" update="saved tableform grid"
                                             action="#{anasitUserBean.createAnasitUser}"/>
                        </h:panelGrid>
                    </h:form>
                </p:fieldset>
                <p:spacer height="20"/>
                <p:fieldset legend="Users">
                    <h:form id="tab">
                        <p:dataTable id="tableform" paginator="true" rows="10" var="uzer"
                                     rowEditListener="#{anasitUserBean.onEditRow}"
                                     value="#{anasitUserBean.anasitUserList}">
                            <f:facet name="header">
                                List of registered Users
                            </f:facet>
                            <p:column sortBy="#{uzer.name.firstName}" filterBy="#{uzer.name.firstName}"
                                      headerText="#{msgs.firstName}">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <h:outputText value="#{uzer.name.firstName}"/>
                                    </f:facet>
                                    <f:facet name="input">
                                        <h:inputText value="#{uzer.name.firstName}"/>
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>
                            <p:column sortBy="#{uzer.name.lastName}" filterBy="#{uzer.name.lastName}"
                                      headerText="#{msgs.lastName}">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <h:outputText value="#{uzer.name.lastName}"/>
                                    </f:facet>
                                    <f:facet name="input">
                                        <h:inputText value="#{uzer.name.lastName}"/>
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>
                            <p:column sortBy="#{uzer.name.middleName}" filterBy="#{uzer.name.middleName}"
                                      headerText="#{msgs.middleName}">
                                <p:cellEditor>
                                    <f:facet name="output">
                                        <h:outputText value="#{uzer.name.middleName}"/>
                                    </f:facet>
                                    <f:facet name="input">
                                        <h:inputText value="#{uzer.name.middleName}"/>
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>
                            <p:column headerText="Options">
                                <p:rowEditor/>
                            </p:column>
                        </p:dataTable>
                    </h:form>

                </p:fieldset>
            </div>


            <div id="footer">
                lukman
            </div>
        </div>
    </div>
</h:body>

</html>